<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ch">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <title>测试</title>
</head>
<body>
<hr>
<center>取值操作</center>
普通取值:
<div th:text="${name}"></div>
富文本:
<div th:utext="${richText}"></div>
对象:
<div th:object="${user}">
    <div th:text="*{id}"></div>
    <div th:text="*{username}"></div>
    <div th:text="*{password}"></div>
    <div th:text="*{nickname}"></div>
</div>
在标签内获取值:
<div th:object="${user}">
    <div>id:[[*{id}]]</div>
    <div>用户名:[[*{username}]]</div>
    <div>密码:[[*{password}]]</div>
    <div>昵称:[[*{nickname}]]</div>
</div>
在js脚本中获取值:
<script th:inline="javascript">
    console.log("在js脚本中获取值",[[${name}]]);
</script>
<hr>
<center>数据处理:</center>
<div th:object="${user}">
    <div th:text="*{id}"></div>
    <div th:text="*{username}"></div>
    <div th:text="*{password}"></div>
    <div th:text="*{nickname}"></div>
    <div th:text="${#dates.format(user.birthday,'yyyy-MM-dd')}"></div>
</div>
<hr>
<center>地址操作:</center>
<div class="test">123</div>
<hr>
<center>获取内置对象:</center>
<div th:text="'获取内置对象------>'+${session.session}"></div>
<hr>
</body>
</html>